import React, { useEffect, useState } from 'react'
import * as api from './server'
import './css/collect.css'
const Collect = () => {
    const [list, setList] = useState([]);
    useEffect(() => {
        api.getCollect('HL1115')
            .then(res => {
                console.log(res)
                setList(res.data)
            })
    }, [])
    return (
        <div className='collect'>
            <header className='welcome'>
                欢迎来到收藏中心
            </header>
            <ul className='colList'>
                {
                    list.map(item => {
                        return <li key={item.id}>
                            {item.title}
                        </li>
                    })
                }
            </ul>

        </div>
    )
}

export default Collect